import { defineStore } from "pinia";
import { store } from "@/store";

interface MapState {
  draw: boolean;
}

export const useMapStore = defineStore({
  id: "app-map",
  state: (): MapState => ({
    draw: false,
  }),
  getters: {},
  actions: {
    updateDraw(val: boolean) {
      this.draw = val;
    },
  },
});

// Need to be used outside the setup
export function useMapStoreWithOut() {
  return useMapStore(store);
}
